<?php
/**
 * Created by YuanXiBlog.
 * User: YuanXi
 * Date: 2021/6/12 0012
 * Time: 1:45
 */

namespace App\Transformers;

use App\Models\Category;
use League\Fractal\TransformerAbstract;

class CategoryTransformer extends TransformerAbstract
{
    public function transform(Category $category)
    {
        return [
            'id' => $category->id,
            'name' => $category->name,
        ];
    }
}
